前言
这篇笔记的主要内容是关于Bioconductor的一些备忘录(cheat sheet),作者总结的不错,我就按原文翻译了下来,由于一些知识点并没有学到,因此未翻译,后面学到后,再回头过来翻译。
安装
安装细节参考http://bioconductor.org/install/,具体代码如下所示:
|
|
R语言帮助
简单的帮忙如下所示:
|
|
高级用户的帮助功能
|
|
Bioconductor相关的论坛: https://support.bioconductor.org
如果你使用的Rstudio,则可以使用?
或help
来查看帮忙文档,如果使用是命令行模式(例如Linux),则可以使用下面的代码通过浏览器来查看帮助文档(我使用的Rstudio,因此未尝试以下代码):
|
|
debugging R
|
|
显示某个类的包特异方法
以下两个段代码实现的功能大致相同:查看特定的某个包中,某个特定类对象的操作方法。给定类的对象的操作方法。
|
|
注释Annotations
这里需要先更新一下AnnotationHub,现在我们查看一下AnnotationHub的某个案例:
https://master.bioconductor.org/packages/release/bioc/html/AnnotationHub.html
以下代码是如何使用数据库包,以及biomart
,先看AnnotationDbi:
|
|
这个包主要用于各种基因ID的转换。
|
|
GenomicRanges包
GenomicRanges这个包用于分析高通量测序数据,它能有效地表壳与操作基因组注释信息(genomic annotations)与比对结果(alignments)。GenomicRanges包定义了一个通用容器,此容器用于储存与操作基因间隔(genomic intervals)与变量(variables)。在GenomicAlignments包和SummarizedExperiment包中定义了一个更加特殊的容器,GenomicAlignments包中的这个更加特殊的容器可以根据一个参考基因组来表示和操作一些短比对结果(short alignments),SummarizedExperiment包中容器可以构建一个实验的矩阵样汇总信息。
此包的使用如下所示:
|
|
Intra-range methods
不清楚功能,后面补充。
Affects ranges independently
function | description |
---|---|
shift | moves left/right |
narrow | narrows by relative position within range |
resize | resizes to width, fixing start for +, end for - |
flank | returns flanking ranges to the left +, or right - |
promoters | similar to flank |
restrict | restricts ranges to a start and end position |
trim | trims out of bound ranges |
+/- | expands/contracts by adding/subtracting fixed amount |
* | zooms in (positive) or out (negative) by multiples |
Inter-range methods
Affects ranges as a group
function | description |
---|---|
range | one range, leftmost start to rightmost end |
reduce | cover all positions with only one range |
gaps | uncovered positions within range |
disjoin | breaks into discrete ranges based on original starts/ends |
Nearest methods
Given two sets of ranges, x
and subject
, for each range in x
, returns…
function | description |
---|---|
nearest | index of the nearest neighbor range in subject |
precede | index of the range in subject that is directly preceded by the range in x |
follow | index of the range in subject that is directly followed by the range in x |
distanceToNearest | distances to its nearest neighbor in subject (Hits object) |
distance | distances to nearest neighbor (integer vector) |
A Hits object can be accessed with queryHits
, subjectHits
and mcols
if a distance is associated.
set methods
If y
is a GRangesList, then use punion
, etc. All functions have default ignore.strand=FALSE
, so are strand specific.
|
|
Overlaps
|
|
Seqnames and seqlevels
GenomicRanges and GenomeInfoDb
|
|
Sequences
Biostrings是一个操作序列或序列集的包,简要操作可以参考Biostrings Quick Overview PDF,关于一些物种的,缩写的信息可以参考cheat sheet for annotation
|
|
|
|
|
|
测序数据
Rsamtools中的 scanBam
返回BAM文件中的原始数值:
|
|
GenomicAlignments 返回一个Bioconductor对象(GRanges-based)
|
|
转录本数据库
|
|
根据范围(ranges)和实验汇总信息
SummarizedExperiment
是高维数据的储存类, 它与GRanges
或GRangesList
配合使用(使用每个基因外显子的read计数)。
|
|
Salmon是一个定量工具,如果数据占有GC依赖的数据,那么就添加上--gcBias
参数,接着使用 tximport,以下是使用案例:
|
|
Rsubread包中的featureCounts
函数也可以用于read计算,速度可能更快。
|
|
RNA-seq分析方法
DESeq2:My preferred pipeline for DESeq2 users is to start with a lightweight transcript
abundance quantifier such as Salmon
and to use tximport, followed
by DESeqDataSetFromTximport
.
Here, coldata
is a data.frame with group
as a column.
|
|
|
|
|
|
更多有关RNA-seq操作的包可以参考:Many more RNA-seq packages
表达数据集Expression set
|
|
下载GEO数据库
|
|
芯片分析
|
|
iCOBRA包
iCOBRA包用于计算和可视化排序数据以及二分类匹配后的数据。例如,iCOBRA包的一个典型用途就是用于评估基因表达实验中不同组之间的比较方法,我们可以视之为一个排序问题(评估正确的效应量(effect size)以及按照显著性进行排列的基因),还是一个二分类比较问题(binary assignment problem)(例如将基因分为差异表达和非差异表达)。
|
|